package com.ddyx.common.framework.exception;

import com.ddyx.common.base.enums.ApiResultType;

/**
 * 自定义异常类
 * @author agula
 * @date 2019-07-16 13:18
 */
public class FilialException extends RuntimeException {
	private static final long serialVersionUID = -3825504714870424800L;
	private String message;
	private Integer errorCode;

	public FilialException(Integer errorCode, String message) {
		super(message);
		this.errorCode = errorCode;
		this.message = message;
	}

	public FilialException(ApiResultType exceptionType) {
		super(exceptionType.getMessage());
		this.errorCode = exceptionType.getCode();
		this.message = exceptionType.getMessage();
	}

	public Integer getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(Integer errorCode) {
		this.errorCode = errorCode;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
}
